package com.scott.configuration;

import com.scott.bean.StudentBean;
import com.scott.condition.LinuxCondition;
import com.scott.condition.WindowsCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;

/**
 * 如果是windows系统 就放 盖茨
 * 如果是linux系统   就放 林纳斯
 */
public class ScottConfiguration {


    @Conditional({WindowsCondition.class})
    @Bean(name="bill")
    public StudentBean student01(){
        return  new StudentBean("盖茨",60);
    }

    @Conditional({LinuxCondition.class})
    @Bean(name="linus")
    public StudentBean student02(){
        return  new StudentBean("林纳斯",48);
    }
}
